package org.opens.javaskill.thread.demo.myLock;

import java.util.Collection;

/**
 * @Date 2020/8/15 15:04
 * @Created by 99126
 */
public interface Lock {

    public static class TimeOutException extends Exception {

        public TimeOutException(String message) {
            super(message);
        }

    }

    void lock() throws InterruptedException;

    void lock(long mills) throws InterruptedException, TimeOutException;

    void unLock();

    Collection<Thread> getBlockedThread();

    int getBlockedThreadSize();

}
